<html xmlns:th="http://www.thymeleaf.org" xmlns:x="http://www.w3.org/1999/html">
<div class="easyui-layout" data-options="fit:true,border:false">
    <div data-options="region:'center',border:false" title="" style="overflow: hidden;padding: 3px;">
        <form id="baiduAddressReverseEditForm" method="post">
            <table class="grid">
                <input name="id" type="hidden" th:value="${baiduAddressReverse.id}">
                <tr>
                    <td></td>
                    <td><input name="id" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true" th:value="${baiduAddressReverse.id}"></td>
                    <td></td>
                    <td><input name="adcode" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true" th:value="${baiduAddressReverse.adcode}"></td>
                </tr>
                <tr>
                    <td></td>
                    <td><input name="city" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true" th:value="${baiduAddressReverse.city}"></td>
                    <td></td>
                    <td><input name="cityCode" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true" th:value="${baiduAddressReverse.cityCode}"></td>
                </tr>
                <tr>
                    <td></td>
                    <td><input name="cityLevel" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true" th:value="${baiduAddressReverse.cityLevel}"></td>
                    <td></td>
                    <td><input name="country" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true" th:value="${baiduAddressReverse.country}"></td>
                </tr>
                <tr>
                    <td></td>
                    <td><input name="countryCode" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true" th:value="${baiduAddressReverse.countryCode}"></td>
                    <td></td>
                    <td><input name="countryCodeIso" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true" th:value="${baiduAddressReverse.countryCodeIso}"></td>
                </tr>
                <tr>
                    <td></td>
                    <td><input name="direction" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true" th:value="${baiduAddressReverse.direction}"></td>
                    <td></td>
                    <td><input name="distance" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true" th:value="${baiduAddressReverse.distance}"></td>
                </tr>
                <tr>
                    <td></td>
                    <td><input name="district" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true" th:value="${baiduAddressReverse.district}"></td>
                    <td></td>
                    <td><input name="formattedAddress" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true" th:value="${baiduAddressReverse.formattedAddress}"></td>
                </tr>
                <tr>
                    <td></td>
                    <td><input name="lat" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true" th:value="${baiduAddressReverse.lat}"></td>
                    <td></td>
                    <td><input name="lng" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true" th:value="${baiduAddressReverse.lng}"></td>
                </tr>
                <tr>
                    <td></td>
                    <td><input name="province" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true" th:value="${baiduAddressReverse.province}"></td>
                    <td></td>
                    <td><input name="sematicDescription" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true" th:value="${baiduAddressReverse.sematicDescription}"></td>
                </tr>
                <tr>
                    <td></td>
                    <td><input name="street" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true" th:value="${baiduAddressReverse.street}"></td>
                    <td></td>
                    <td><input name="remark" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true" th:value="${baiduAddressReverse.remark}"></td>
                </tr>
                <tr>
                    <td></td>
                    <td><input name="streetNumber" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true" th:value="${baiduAddressReverse.streetNumber}"></td>
                <tr>
                    <td></td>
                    <td><input name="town" type="text" placeholder="请输入" class="easyui-validatebox"
                               data-options="required:true" th:value="${baiduAddressReverse.town}"></td>
                </tr>
            </table>
            </table>
        </form>
    </div>
</div>
<script type="text/javascript">
    $(function () {
        $('#baiduAddressReverseEditForm').form({
            url: basePath + '/baiduAddressReverse/edit',
            onSubmit: function () {
                progressLoad();
                var isValid = $(this).form('validate');
                if (!isValid) {
                    progressClose();
                }
                return isValid;
            },
            success: function (result) {
                progressClose();
                result = $.parseJSON(result);
                if (result.code === 1) {
                    //之所以能在这里调用到parent.$.modalDialog.openner_dataGrid这个对象，是因为list页面预定义好了
                    parent.$.modalDialog.openner_dataGrid.datagrid('reload');
                    parent.$.modalDialog.handler.dialog('close');
                } else {
                    var form = $('#baiduAddressReverseEditForm');
                    parent.$.messager.alert('错误', result.msg, 'error');
                }
            }
        });

        $("#baiduAddressReverseEditStatus").val('[[${baiduAddressReverse.status}]]');
    });
</script>
